import { DefaultLayout } from '@/layout'
import type { Route } from '@/layout/components'

export default {
  path: '/coupon',
  name: 'Coupon',
  component: DefaultLayout,
  redirect: '/coupon/couponManage',
  meta: {
    title: '优惠券管理',
    icon: 'menu-coupon',
    alwaysShow: true,
    sort: 2,
    roles: ['优惠券管理']
  },
  children: [
    {
      path: 'couponManage',
      name: 'CouponManage',
      component: () => import('@/views/coupon/couponManage'),
      meta: { title: '优惠券管理', roles: ['优惠券列表'] }
    },
    {
      path: 'codeLibrary',
      name: 'CodeLibrary',
      component: () => import('@/views/coupon/codeLibrary'),
      meta: { title: '码库', hidden: true }
    },
    {
      path: 'couponCreate',
      name: 'CouponCreate',
      component: () => import('@/views/coupon/couponCreate'),
      meta: { title: '新建优惠券', hidden: true }
    },
    {
      path: 'couponEdit',
      name: 'CouponEdit',
      component: () => import('@/views/coupon/couponEdit'),
      meta: { title: '编辑优惠券', hidden: true }
    }
  ]
} as Route
